module.exports = {
    entry: {
        "app":__dirname + '/main/src/index.js',
        "demo":__dirname + '/main/src/demo.js'
    },
    output: {
        path: __dirname + '/build',
        publicPath: "/build/",
        filename: '[name].js'
    },
    externals: {
        'react': 'React'
    },
    devtool: 'source-map',  //生成source file
    module: {
        loaders: [
          {
            test: /\.js$/,
            exclude: /node_modules/,
            loader: 'babel-loader',
            query: {
              presets: ['es2015', 'react']
            }
          },
          {
            test: /\.css$/,
            loader: 'style-loader!css-loader?modules'//跟前面相比就在后面加上了?modules
          }
        ]
    }
};